package com.yf.ability.business.file.config;

import com.alibaba.fastjson.JSON;
import com.yf.ability.business.file.config.provider.LocalConfig;
import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;

import java.util.Map;

@Data
@Configuration
@ConfigurationProperties(prefix = "config.ability.file")
public class FileConfig {


    /**
     * 文件存储提供商
     */
    private String provider;

    /**
     * 文件上传配置
     */
    private Map<String,String> data;


    /**
     * 获取本地文件上传配置
     * @return
     */
    public LocalConfig getLocalConfig(){
        return JSON.parseObject(JSON.toJSONString(data), LocalConfig.class);
    }


}
